package com.example.testscalaandroid2.act

import org.scaloid.common.SActivity
import org.scaloid.common.SVerticalLayout
import org.scaloid.common.STextView
import com.example.testscalaandroid2.R
import android.telephony.SmsManager
import scala.collection.convert.WrapAsScala
import org.scaloid.common.SEditText
import org.scaloid.common.SButton
class App1 extends SActivity with WrapAsScala {
  onCreate {
    contentView = new SVerticalLayout {
      STextView(R.string.mobileNo)
      val txtMobileNo = SEditText().ems(10).padding(10.dip)
      STextView(R.string.content) padding 10.dip
      val txtSMS = SEditText().minLines(3).ems(10) padding 10.dip
      SButton(R.string.send, {
        val smsMsg = SmsManager.getDefault()
//        smsMsg.divideMessage(txtSMS.text.toString).foreach { text =>
//          smsMsg.sendTextMessage(txtMobileNo.text.toString, null, text, null, null)
//        }
        //toast(R.string.success)
        longToast(R.string.success)
        info("ok")
      }) //.<<.wrap.>>
    } padding 10.dip //.<<.fill.>>
  }
}

